/*

* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     Smart-Shop开源商城系统/ Java商城-首选电商平台系统 请务必保留此注释头信息
* |     开源地址: https://gitee.com/ningbo-qishan/gruul-mall
* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     可正常分享和学习源码,未经授权 不可商用！
* |     商业版中台购买/开源版商业授权 联系技术客服
* |     官网:  https://www.73app.cn/
* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     Copyright (c) 2016-2999 宁波启山智软科技有限公司
* |     版权所有 ,侵权必究！
* ------------------------------------------------------------------------

*/
package com.medusa.gruul.integral.api.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.medusa.gruul.common.data.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 积分明细表

 * </p>
 *
 * @author xiaoq
 * @since 2019-11-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_integral_detail")
@ApiModel(value = "IntegralDetail对象", description = "积分明细表 ")
public class IntegralDetail<T extends Model<?>> extends Model<T> implements Serializable {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "积分明细表id")
	@TableId(value = "integral_detail_id", type = IdType.AUTO)
	private Long integralDetailId;

	@ApiModelProperty(value = "用户id")
	@TableField("user_id")
	private String  userId;

	@ApiModelProperty(value = "积分订单id")
	@TableField("prize_order_id")
	private Long prizeOrderId;

	@ApiModelProperty(value = "类别  1. 兑换积分商品(减少) 2.购买商品(增加) 3.使用积分购买商品(减少) 4,登入首次登录,5.每日首次分享 6.签到 7.每日步数达标 8.商家充值9.商家扣除 10.清空")
	@TableField("gain_integral_type")
	private Integer gainIntegralType;

	@ApiModelProperty(value = "购买商品数量")
	@TableField("quantity")
	private Integer quantity;

	@ApiModelProperty(value = "积分值")
	@TableField("integral")
	private BigDecimal integral;

	@ApiModelProperty(value = "现有积分(计算当前用户的积分值是多少)")
	@TableField("now_the_integral")
	private BigDecimal nowTheIntegral;

	@ApiModelProperty(value = "明细名(预留字段)")
	@TableField("detail_name")
	private String detailName;

	@ApiModelProperty(value = "是否已经进行清空计算 0-否 1-是")
	@TableField("is_clear")
	private Boolean clear;

	@ApiModelProperty(value = "商铺Id")
	@TableField("shop_id")
	private String shopId;

	@ApiModelProperty("租户ID")
	private String tenantId;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty("创建时间")
	@TableField(fill = FieldFill.INSERT)

	private LocalDateTime createTime;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty("更新时间")
	@TableField(fill = FieldFill.INSERT_UPDATE)


	private LocalDateTime updateTime;
	@TableLogic
	@ApiModelProperty("删除状态：0->未删除；1->已删除")
	@TableField(value = "is_deleted", fill = FieldFill.INSERT)
	private Boolean deleted;

}
